﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Title</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        div{
            width: 100%;
            height: 300px;
            /*background-color: red;*/
            background: linear-gradient(to right,red,blue);
        }
    </style>
</head>
<body>
<div></div>
<script>
    var div=document.querySelector("div");
    /*开始触摸*/
    div.addEventListener("touchstart",function(e){
        console.log(e);
        console.log(e.changedTouches[0]);
        //console.log(e.targetTouches[0].clientX +"  : "+e.targetTouches[0].clientY);
    });
    /*触摸滑动*/
    /*触摸结束*/
    div.addEventListener("touchend",function(e){
//        console.log(e.changedTouches);
    })
</script>
</body>
</html>